package cn.wenhaha.app.job.manager;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.wenhaha.common.db.bean.SysMapping;
import cn.wenhaha.job.WynJobBean;
import org.quartz.*;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * --------
 *
 * @author ：wyndem
 * @Date ：Created in 2022-10-30 21:19
 */
@DisallowConcurrentExecution
public class DemoJob  extends WynJobBean {

    @Resource
    private Scheduler scheduler;

    @Resource
    private SysMapping sysMapping;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        System.out.println("你好: " + DateUtil.now());
        ThreadUtil.sleep(10,TimeUnit.SECONDS);
        System.out.println("世界 " + DateUtil.now());
        System.out.println();
    }
}
